package practicedemo34;

public class GirlFriendTest {
    public static void main(String[] args) {
        GirlFriend[] arr = new GirlFriend[4];
        arr[0] = new GirlFriend("小红",19,"打男朋友");
        arr[1] = new GirlFriend("小花",20,"花钱");
        arr[2] = new GirlFriend("小天",21,"疼男朋友");
        arr[3] = new GirlFriend("小美",23,"长得漂亮");
        for (int i = 0; i < arr.length; i++) {
            if (arr[i].getAge()<AVE(arr[0].getAge(),arr[1].getAge(),arr[2].getAge(),arr[3].getAge())){
                System.out.println(arr[i].getName());
            }
        }

    }
    public static double AVE(double age1,double age2,double age3,double age4){
        return (age1+age2+age3+age4)/4;
    }
}
